<template>
	<view class="">
		<u-navbar title="积分商城" :autoBack="true" :placeholder="true"></u-navbar>

		<view class="">

			<view class="list">
				<view class="" v-for="item in list" key="index">

					<view class="coupon-item-box">
						<view class="coupon-pic">
							<image mode="aspectFit" class="he-img" :src="item.goods_image"></image>
						</view>
						<view class="coupon-item-con">
							<view class="coupon-item-name">
								{{item.name}}
							</view>
							<text class="coupon-item-desc">{{ item.price }}米粒(&nbsp;可兑换&nbsp;)</text>
						</view>
						<view class="coupon-item-operation">
							<text>积分兑换商品</text>
						</view>
					</view>


				</view>
			</view>
		</view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: null, //商品列表
			}
		},
		onShow() {
			this.getmiligoods();
		},

		methods: {
			// 获取积分列表
			async getmiligoods() {
				let res = await this.$api.getmiligoods()
				this.list = res.data.data
			},
		}
	}
</script>

<style lang="scss" scoped>
	.list {
		margin-top: 20rpx;
	}

	.coupon-item-box {
		background-color: white;

		&.completion-collection {
			view {
				color: #999 !important;
			}
		}

		&:after {
			content: '';
			position: absolute;
			top: -14rpx;
			left: 514rpx;
			z-index: 3;
			width: 30rpx;
			height: 30rpx;
			background-color: #fff;
			border-radius: 50%;
		}

		&:before {
			content: '';
			position: absolute;
			bottom: -14rpx;
			left: 514rpx;
			z-index: 3;
			width: 30rpx;
			height: 30rpx;
			background-color: #fff;
			border-radius: 50%;
		}

		position: relative;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 16rpx;
		border-radius: 12rpx;
		// background-color: lighten($base-color, 45%);

		.coupon-item-con {
			width: 316rpx;
			margin-right: auto;
			padding-right: 20rpx;
			height: 156rpx;
			border-right: 1px dashed #fff;
			line-height: 1;
			// font-size: $ns-font-size-base;

			text {
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
				display: inherit;
			}
		}

		.coupon-item-operation {
			margin-right: 10rpx;
			color: #111;
			// color: $base-color;
			// font-size: $ns-font-size-base;
		}

		.coupon-item-name {
			margin-top: 14rpx;
			white-space: nowrap;
			overflow: hidden;
			text-overflow: ellipsis;
		}

		.num {
			margin-left: 4rpx;
			margin-right: 10rpx;
			// font-size: $ns-font-size-lg + 12rpx;
			font-weight: 600;
			display: inline-block !important;
			overflow: initial !important;
		}
	}


	.coupon-pic {
		width: 144rpx;
		height: 144rpx;
		margin-right: 30rpx;

		image {
			width: 144rpx;
			height: 144rpx;
		}
	}
	
	.coupon-item-desc{
		margin-top: 30rpx;
	}
</style>